<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset= UTF-8>
    <title>查看历史订单</title>
    <link rel="StyleSheet" href="../css/jpetstore.css" type="text/css" media="screen" />

</head>
<body>
<div th:replace="common/top">
</div>
<div id="BackLink">
<!--    <a href="main">Return to Main Menu</a>-->
    <a th:href="@{view}">Return to Main Menu</a>
</div>
<div id="Content">
    <h2 align="center">My Orders</h2>

    <table align="center">
        <tr>
            <th>Order ID</th>
            <th>Date</th>
            <th>Total Price</th>
        </tr>

<!--        <c:forEach var="order" items="${sessionScope.orderList}">-->
            <tr th:each="order:${session.orderList}">
                <td th:href="@{'viewOrder?orderId='+${order.orderId}}" th:text="${order.orderId}">
<!--                    <a href="viewOrder?orderId=${order.orderId}">${order.orderId}</a>-->
                </td>
                <td th:text="${#dates.format(order.orderDate, 'yyyy-MM-dd HH:mm')}">
<!--                <td th:text="${order.orderDate}">-->
<!--                    <fmt:formatDate value="${order.orderDate}" pattern="yyyy/MM/dd" />-->
                </td>
                <td th:text="'$'+${#numbers.formatDecimal(order.totalPrice,1,'COMMA',2,'POINT')}">
<!--                <td th:text="${order.totalPrice}">-->
<!--                    <fmt:formatNumber value="${order.totalPrice}" pattern="$#,##0.00" />-->
                </td>
            </tr>
<!--        </c:forEach>-->
    </table>
</div>

<div th:replace="common/bottom">
</div>
</body>
</html>